package com.lp.business.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.iframework.support.spring.hibernate.model.BaseHibernateModelSupport;

/**
 * 订阅信息模型
 * 
 * @author lp
 * @date 2018-08-08 18:23:41
 */
@Entity
@Table(name = "subscription")
@org.hibernate.annotations.Table(appliesTo = "subscription", comment = "订阅信息模型")
public class Subscription extends BaseHibernateModelSupport {
	private static final long serialVersionUID = 1L;
	
	/** 订阅行业Id */
	@Column(columnDefinition = "varchar(32)  comment '订阅行业Id'")
	private String industryId;
	
	/** 订阅行业 */
	@ManyToOne(cascade = { CascadeType.MERGE }, fetch = FetchType.LAZY)
	@JoinColumn(name = "industryId", nullable = true, insertable = false, updatable = false)
	private Industry industry;
	
	/** 订阅人Id */
	@Column(columnDefinition = "varchar(32)  comment '订阅人Id'")
	private String memberId;
	
	/** 订阅人 */
	@ManyToOne(cascade = { CascadeType.MERGE }, fetch = FetchType.LAZY)
	@JoinColumn(name = "memberId", nullable = true, insertable = false, updatable = false)
	private Member member;
	
	/**
	 * 订阅有效期
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(columnDefinition = "datetime comment '订阅有效期'", updatable = false)
	private Date expiryDate;

	public String getIndustryId() {
		return industryId;
	}

	public void setIndustryId(String industryId) {
		this.industryId = industryId;
	}


	public Industry getIndustry() {
		return industry;
	}

	public void setIndustry(Industry industry) {
		this.industry = industry;
	}

	public String getMemberId() {
		return memberId;
	}

	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}

	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	public Date getExpiryDate() {
		return expiryDate;
	}

	public void setExpiryDate(Date expiryDate) {
		this.expiryDate = expiryDate;
	}
	
}
